import Vue from 'vue';
import VueRouter from 'vue-router';//使用插件
Vue.use(VueRouter);

//引入Luyou 组件
import HomeWord from '../views/Home.vue';
import Shop from '../views/center/shop.vue';
import center from '../components/center.vue';
// import  from '../components/center.vue';
import Login from '../views/Login';
import Reg from '../views/reg.vue';
import index from '../components/register/RegisterVue.vue';
import Sms from '../components/register/RegisterVue1.vue';
import Pwd from '../components/register/RegisterVue2.vue';
import GoodsDetail from '../views/GoodsDetail.vue';
import My from '../views/center/My.vue'
import shopCategory from '../views/center/shopCategory.vue';
import shopCar from '../views/center/ShoppingCart.vue';
import SetOne from '../components/InformationModification/set.vue';
//创建router实例对象，去管理一组一组的路由规则
const router = new VueRouter({
	routes: [
		{ path: '/login', component: Login },

		{
			path: '/home',
			component: HomeWord,
			children: [
				{ path: '/home/center', component: center },

				// {path: '/home/my', component:My},

				{ // 配置默认路由
					path: "/home", // 路由地址
					// redirect:"/home/shop" // 重定向
					redirect: "/home/center" // 重定向
				},
			]

		},
		{ path: '/shop', component: Shop },
		{
			path: '/reg',
			component: Reg,
			children:[
				{path:'/reg/index',component:index},
				{path:'/reg/sms',component:Sms},
				{path:'/reg/pwd',component:Pwd},
				{
					path:'/',
					component:index
				},
			]
			
		},
		{ path: '/goodsdetail/:goodsid', component: GoodsDetail },
		{ path: '/my', component: My },
		{ path: '/brandGoods', component: shopCategory },
		{ path: '/shoppingcar', component: shopCar},
		{ path: '/setone', component: SetOne},


		// {path:'/register',component:Reg},
		{ // 配置默认路由
			path: "/", // 路由地址
			redirect: "/home" // 重定向
		},
	]
})

//暴露router
export default router